1. Field of the Invention
The present invention relates to a printing apparatus (a printer), a printer initialization method, and a computer-readable data storage medium recording a program for controlling a printer. More particularly, the present invention relates to an initialization process that is accomplished when the printer is turned on, and an initialization process that is accomplished in response to a printer reset request from a host device.
2. Description of the Related Art
Printing apparatuses (referred to below as xe2x80x9cprintersxe2x80x9d) typically perform a predetermined printer initialization process when the printer power is turned on, when the printer begins operation, and also when a reset request is received by the printer from a host computer or from the host device in a point-of-sale (POS) terminal with which the printer is used.
Systems in which the power supplies of the printer and host device are linked such that the printer and host device power turns on substantially simultaneously are widely used, for example, in POS systems. When printer power turns on in conjunction with host power in such systems, the host device BIOS (basic input output system) typically sends a reset request to the printer. Then, the operating system (OS) that runs on the host device sends a reset request to the printer, and then the application program that runs on the OS sends another reset request to the printer. This means that when a conventional printer that executes a predetermined printer initialization process when the power is turned on is used in this type of system, multiple reset requests are asserted by the host to the printer before the printer can complete the predetermined initialization process caused by the power-on reset of the printer.
When the printer receives a reset request from the host device, the printer CPU controlling general printer operation is reset. This causes CPU operation to stop and drives all I/O ports to a high impedance state, thus interrupting any initialization process that was started when printer power was turned on and is still in progress when the reset request from the host device is received.
Problems Relating to Initialization Process Interruption
Printer initialization typically includes the following tasks:
a) initializing such control circuits as the CPU controlling printer operation, and RAM used as a communications buffer for communicating with the host device;
b) excitement of the stepping motor phase for matching the operating phase of, for example, the stepping motor for driving the print head in the line direction;
c) a cleaning process for cleaning the printing elements of the print head to assure print quality; and
d) moving the print head to a reference position in the line direction.
Some of these initialization processes require more time than others. For example, phase excitement of the stepping motors requires relatively little time, while print head positioning and print head cleaning require relatively more time.
The cleaning process required to clean an ink jet print head includes a suction step in which a vacuum pump is used to suction ink from the print head, and thus consumes a quantity of ink. It also takes time for suction to actually begin once the vacuum pump starts operating, and interrupting the cleaning process is therefore also a wasteful use of time. Yet further, interrupting this cleaning process once ink suction has begun means the amount of ink that has been drawn so far is unknown. The suction step can therefore not be resumed, and must be repeated from the beginning. This obviously consumes more ink than does completing the suction step uninterrupted.
Problems Relating to Reseating the Initialization Process
When reset requests are repeatedly issued, the initialization process is performed in response to each reset request. This causes the following problems.
A stepping motor must be driven to position the print head to the reference position. The gear set, including the gears connected to the stepping motor, is therefore driven to move the print head, and repeating this positioning process in response to redundant reset requests needlessly advances wear on the associated mechanical parts.
It is also not normally possible to know where the print head is positioned when this operation starts. It is therefore necessary to move the print head to a known position against a stopper, and repeatedly driving the print head against this stopper can result in damage to the print head.
Repeatedly performing the cleaning process described above also consumes a needlessly large amount of ink, and thus makes it necessary to replace the ink cartridge sooner.
Repeatedly performing the initialization process is illustrated in FIGS. 1A and 1B. FIG. 1A shows the sequence of processes performed when printer power is turned on independently of the host device, such as when printer power is turned on after the host is operating.
The first step of this initialization process after the power is turned on is stepping motor phase excitement 101, followed by print head positioning 102, and then print head cleaning 103. The printer then proceeds to normal operation 104 in which the printer waits for a print command and data from the host device.
FIG. 1B shows a sequence of processes typically performed when a conventional printer is connected to a host device such that power supply to both the printer and host device begins substantially simultaneously with the resultant reset requests from the host device as described above. In FIG. 1B, a reset signal is asserted by the host device to the printer at the rising edge following a drop in the reset signal output 105. As a result, low level pulses 106, 107, and 108 in the reset signal output 105 indicate reset signals received by the printer.
After the printer completes stepping motor phase excitement 101, and print head positioning 102 is in progress, it receives a reset signal 106 from the host device BIOS. Print head positioning 102 is therefore interrupted, and stepping motor phase excitement 101 and print head positioning 102 are repeated from the beginning.
Next, stepping motor phase excitement 101 and print head positioning 102 are completed, and a reset signal 107 is received from the host device OS while print head cleaning 103 is in progress. Print head cleaning 103 is therefore interrupted, and stepping motor phase excitement 101, print head positioning 102, and print head cleaning 103 are repeated from the beginning.
Next, reset signal 108 is received from the host device application program while print head cleaning 103 is in progress. Print head cleaning 103 is therefore again interrupted, and stepping motor phase excitement 101, print head positioning 102, and print head cleaning 103 are again repeated from the beginning.
In consideration of the above-described problems, an object of the present invention is to prevent wasting of consumables in the printing apparatus, and to prevent a loss of mechanical durability that results when a printer initialization process, performed when printer power is turned on, is interrupted by a printer reset signal asserted by a host device to the printer immediately after host power turns on.
To achieve the above object, a printing apparatus according to the present invention for printing on a printing medium (e.g. paper) using a print head according to data received from a host device comprises: a power on initialization controller for initializing the printing apparatus when the printing apparatus power is turned on; and a first timer for measuring a first predetermined time after the printing apparatus starts operating. The power on initialization controller performs a first initialization process before the first timer finishes measuring the first predetermined time, and performs a second initialization process differing from the first initialization process after the first timer finishes measuring the first predetermined time.
The first initialization process performed by this power on initialization controller before a first predetermined time passes after printer operation starts includes operations that can be completed in a short time and which if interrupted will not lead to problems such as described above. Such operations include, for example, initializing control circuits and stepping motor phase excitement. After this predetermined time passes a second initialization process is performed and includes operations which, if interrupted, can lead to problems. This second initialization process includes, for example, print head cleaning and print head positioning. If this predetermined time is set based on the time required for all reset requests, which are asserted by the host device at host device startup, to be sent from the host, the problems arising from interrupting the initialization process performed when printer power is turned on can be avoided.
A printing apparatus according to the present invention further preferably comprises a reset initialization controller for initializing the printer according to a reset request from the host device. In this case the reset initialization controller performs a third initialization process in response to a reset request before the first timer finishes measuring the first predetermined time, and performs in response to a reset request a fourth initialization process that is not the same as the third initialization process after the first timer finishes measuring the first predetermined time.
In response to reset requests from the host device occurring within a predetermined time after printer operation starts, such as reset requests issued immediately after host device power is turned on, the reset initialization controller thus performs a third initialization process including operations that can be completed in a short time and which, if interrupted, will not lead to problems such as described above. Such operations include, for example, initializing control circuits and stepping motor phase excitation. A complete initialization process including print head cleaning and print head positioning can then be performed in response to reset, requests, such as reset requests issued in conjunction with a printing request, from the host after this predetermined time has expired. Problems arising from the initialization process being interrupted by frequent reset requests asserted immediately after host device power is turned on can therefore be avoided.
The third initialization process in this case is preferably substantially the same as the first initialization process. The initialization process performed when power is turned on, and the initialization process based on a reset request from the host device, can thus be accomplished by means of the same circuits or software. This is accomplished by, for example, connecting the reset terminal of the CPU to the output of the logical OR of the reset signal asserted when power is turned on and the reset signal received from the host device.
Further preferably in this case, the third initialization process is included in the fourth initialization process. As a result, processing reset requests from the host device can be started using the same circuit or software with the processing of such request branching after completing the third initialization process based on the whether or not the predetermined time has passed. A simple circuit or software design is used for this process. For example, a reset signal from the host device is input to the CPU interrupt terminal, and the value of a timer is evaluated during the interrupt process to determine which process is to be run.
Yet further preferably the printing apparatus of the present invention comprises nonvolatile memory for storing time data corresponding to the first predetermined time; and a data changing circuit for updating the time data corresponding to the first predetermined time stored in the nonvolatile memory.
In this case it is possible to dynamically change the predetermined time according to the host device characteristics, or more specifically the period in which frequent reset requests are asserted by the host device immediately after the power is turned on, and this predetermined time can be maintained even after printer power is turned off. In addition, the predetermined time can be adjusted and the above-described benefits obtained even when the host device is replaced.
Yet further preferably the printing apparatus of the present invention comprises a command detector for detecting a predetermined command in data received from the host device. In this case the data changing circuit can update the time data according to the predetermined command detected by the command detector.
In this case the above-noted predetermined time can be set by the host device to a value optimized for the characteristics of the host device by way of the printer interface. Such a host device function is preferably incorporated into the host device BIOS or other basic host device program.
Yet further preferably the printing apparatus of the present invention comprises a reset detecting circuit for detecting a last startup reset request, which is a last reset request in a plurality of reset requests generated by the host device startup process; and a second timer for measuring a time elapsed from the start of printing apparatus operation to the last startup reset request as detected by the reset detecting circuit. In this case the data changing circuit can update the time data based on the time measured by the second timer.
In this case the printer includes a learning function whereby it can automatically determine the best predetermined time based on the time required to receive the last of the reset requests frequently occurring immediately after host device power turns on. This learning function further increases the adaptability of the printer to various host devices.
Yet further preferably the printing apparatus of the present invention comprises a second timer for measuring from the start of printing apparatus operation a second predetermined time that is longer than the first predetermined time. In this case the reset detecting circuit detects as the last startup reset request the last reset request generated before the third timer finishes measuring the second predetermined time.
By defining a maximum value that could be used for the first predetermined time, and assigning this value to the second predetermined time, the first predetermined time can be set within the range below this maximum value. It is therefore possible to prevent an infinite delay in the start of the second initialization process, and the printer startup time can be regulated.
Yet further preferably the data changing circuit adds a predetermined deviation time to the time measured by the second timer to generate the time data, and stores this time data in nonvolatile memory. It is therefore possible to account for slight variations in host device characteristics, and stable initialization can thus be achieved.
Yet further preferably the printing apparatus of the present invention comprises a mode selector for selecting and setting the initialization mode of the power on initialization controller to a first mode or a second mode. In the first mode the power on initialization controller performs a first initialization process before the first timer finishes measuring the first predetermined time, and performs a second initialization process differing from the first initialization process after the first timer finishes measuring the first predetermined time. In the second mode the power on initialization controller performs the first initialization process and second initialization process before the first timer finishes measuring the first predetermined time.
When power is turned on to a printer thus comprised, it is determined, for example, whether print head cleaning is necessary. If it is necessary, then the first mode is selected; if not, the second mode can be selected. It should be noted that if the second initialization process is selected when cleaning is not necessary, the cleaning process is not included in the second initialization process. As a result, the second initialization process can be interrupted without resulting in unnecessary ink consumption. The second mode can therefore be selected in this case to perform all initialization processes without waiting for the predetermined time to pass, and thereby shorten the printer startup time.
It should be further noted that the present invention has the greatest benefit when interruption of the print head cleaning process can be avoided. The first and second initialization processes are therefore preferably mutually exclusive, and print head cleaning is preferably included in the second initialization process, that is, print head cleaning is preferably not included in the first initialization process.
It will be obvious that a printing apparatus according to the present invention as described above can also be expressed as a printing apparatus initialization method with the same effects and benefits described above.
The initialization method of the present invention is further preferably achieved using a computer. Also included in the present invention, therefore, is a computer-readable data storage medium storing program code for performing the initialization method of the present invention.
Other objects and attainments together with a fuller understanding of the invention will become apparent and appreciated by referring to the following description and claims taken in conjunction with the accompanying drawings.